<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>digichef.registration.forms</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="digichef-module.html">Package&nbsp;digichef</a> ::
        <a href="digichef.registration-module.html">Package&nbsp;registration</a> ::
        Module&nbsp;forms
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="digichef.registration.forms-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="digichef.registration.forms-module.html">Module digichef.registration.forms</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno">  1</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L2"></a><tt class="py-lineno">  2</tt>  <tt class="py-line"><tt class="py-docstring">Forms and validation code for user registration.</tt> </tt>
<a name="L3"></a><tt class="py-lineno">  3</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L4"></a><tt class="py-lineno">  4</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L5"></a><tt class="py-lineno">  5</tt>  <tt class="py-line"> </tt>
<a name="L6"></a><tt class="py-lineno">  6</tt>  <tt class="py-line"> </tt>
<a name="L7"></a><tt class="py-lineno">  7</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">django</tt> <tt class="py-keyword">import</tt> <tt id="link-0" class="py-name" targets="Module digichef.profiles.forms=digichef.profiles.forms-module.html,Module digichef.recipes.forms=digichef.recipes.forms-module.html,Module digichef.registration.forms=digichef.registration.forms-module.html,Module digichef.tagging.forms=digichef.tagging.forms-module.html"><a title="digichef.profiles.forms
digichef.recipes.forms
digichef.registration.forms
digichef.tagging.forms" class="py-name" href="#" onclick="return doclink('link-0', 'forms', 'link-0');">forms</a></tt> </tt>
<a name="L8"></a><tt class="py-lineno">  8</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">django</tt><tt class="py-op">.</tt><tt id="link-1" class="py-name" targets="Module digichef.profiles.utils=digichef.profiles.utils-module.html,Module digichef.recommender.utils=digichef.recommender.utils-module.html,Module digichef.tagging.utils=digichef.tagging.utils-module.html"><a title="digichef.profiles.utils
digichef.recommender.utils
digichef.tagging.utils" class="py-name" href="#" onclick="return doclink('link-1', 'utils', 'link-1');">utils</a></tt><tt class="py-op">.</tt><tt class="py-name">translation</tt> <tt class="py-keyword">import</tt> <tt class="py-name">ugettext_lazy</tt> <tt class="py-keyword">as</tt> <tt class="py-name">_</tt> </tt>
<a name="L9"></a><tt class="py-lineno">  9</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">django</tt><tt class="py-op">.</tt><tt class="py-name">contrib</tt><tt class="py-op">.</tt><tt class="py-name">auth</tt><tt class="py-op">.</tt><tt id="link-2" class="py-name" targets="Module digichef.core.models=digichef.core.models-module.html,Module digichef.profiles.models=digichef.profiles.models-module.html,Module digichef.recipes.models=digichef.recipes.models-module.html,Module digichef.recommender.models=digichef.recommender.models-module.html,Module digichef.registration.models=digichef.registration.models-module.html,Module digichef.tagging.models=digichef.tagging.models-module.html,Module digichef.tagging.tests.models=digichef.tagging.tests.models-module.html,Module digichef.util.models=digichef.util.models-module.html,Module digichef.voting.models=digichef.voting.models-module.html,Module digichef.voting.tests.models=digichef.voting.tests.models-module.html"><a title="digichef.core.models
digichef.profiles.models
digichef.recipes.models
digichef.recommender.models
digichef.registration.models
digichef.tagging.models
digichef.tagging.tests.models
digichef.util.models
digichef.voting.models
digichef.voting.tests.models" class="py-name" href="#" onclick="return doclink('link-2', 'models', 'link-2');">models</a></tt> <tt class="py-keyword">import</tt> <tt class="py-name">User</tt> </tt>
<a name="L10"></a><tt class="py-lineno"> 10</tt>  <tt class="py-line"> </tt>
<a name="L11"></a><tt class="py-lineno"> 11</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-3" class="py-name" targets="Package digichef.registration=digichef.registration-module.html"><a title="digichef.registration" class="py-name" href="#" onclick="return doclink('link-3', 'registration', 'link-3');">registration</a></tt><tt class="py-op">.</tt><tt id="link-4" class="py-name"><a title="digichef.core.models
digichef.profiles.models
digichef.recipes.models
digichef.recommender.models
digichef.registration.models
digichef.tagging.models
digichef.tagging.tests.models
digichef.util.models
digichef.voting.models
digichef.voting.tests.models" class="py-name" href="#" onclick="return doclink('link-4', 'models', 'link-2');">models</a></tt> <tt class="py-keyword">import</tt> <tt id="link-5" class="py-name" targets="Class digichef.registration.models.RegistrationProfile=digichef.registration.models.RegistrationProfile-class.html"><a title="digichef.registration.models.RegistrationProfile" class="py-name" href="#" onclick="return doclink('link-5', 'RegistrationProfile', 'link-5');">RegistrationProfile</a></tt> </tt>
<a name="L12"></a><tt class="py-lineno"> 12</tt>  <tt class="py-line"> </tt>
<a name="L13"></a><tt class="py-lineno"> 13</tt>  <tt class="py-line"> </tt>
<a name="L14"></a><tt class="py-lineno"> 14</tt>  <tt class="py-line"><tt class="py-comment"># I put this on all required fields, because it's easier to pick up</tt> </tt>
<a name="L15"></a><tt class="py-lineno"> 15</tt>  <tt class="py-line"><tt class="py-comment"># on them with CSS or JavaScript if they have a class of "required"</tt> </tt>
<a name="L16"></a><tt class="py-lineno"> 16</tt>  <tt class="py-line"><tt class="py-comment"># in the HTML. Your mileage may vary. If/when Django ticket #3515</tt> </tt>
<a name="L17"></a><tt class="py-lineno"> 17</tt>  <tt class="py-line"><tt class="py-comment"># lands in trunk, this will no longer be necessary.</tt> </tt>
<a name="L18"></a><tt class="py-lineno"> 18</tt>  <tt class="py-line"><tt id="link-6" class="py-name" targets="Variable digichef.registration.forms.attrs_dict=digichef.registration.forms-module.html#attrs_dict"><a title="digichef.registration.forms.attrs_dict" class="py-name" href="#" onclick="return doclink('link-6', 'attrs_dict', 'link-6');">attrs_dict</a></tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt> <tt class="py-string">'class'</tt><tt class="py-op">:</tt> <tt class="py-string">'required'</tt> <tt class="py-op">}</tt> </tt>
<a name="L19"></a><tt class="py-lineno"> 19</tt>  <tt class="py-line"> </tt>
<a name="L20"></a><tt class="py-lineno"> 20</tt>  <tt class="py-line"> </tt>
<a name="RegistrationForm"></a><div id="RegistrationForm-def"><a name="L21"></a><tt class="py-lineno"> 21</tt> <a class="py-toggle" href="#" id="RegistrationForm-toggle" onclick="return toggle('RegistrationForm');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="digichef.registration.forms.RegistrationForm-class.html">RegistrationForm</a><tt class="py-op">(</tt><tt class="py-base-class">forms</tt><tt class="py-op">.</tt><tt class="py-base-class">Form</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="RegistrationForm-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="RegistrationForm-expanded"><a name="L22"></a><tt class="py-lineno"> 22</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L23"></a><tt class="py-lineno"> 23</tt>  <tt class="py-line"><tt class="py-docstring">    Form for registering a new user account.</tt> </tt>
<a name="L24"></a><tt class="py-lineno"> 24</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L25"></a><tt class="py-lineno"> 25</tt>  <tt class="py-line"><tt class="py-docstring">    Validates that the requested username is not already in use, and</tt> </tt>
<a name="L26"></a><tt class="py-lineno"> 26</tt>  <tt class="py-line"><tt class="py-docstring">    requires the password to be entered twice to catch typos.</tt> </tt>
<a name="L27"></a><tt class="py-lineno"> 27</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L28"></a><tt class="py-lineno"> 28</tt>  <tt class="py-line"><tt class="py-docstring">    Subclasses should feel free to add any additional validation they</tt> </tt>
<a name="L29"></a><tt class="py-lineno"> 29</tt>  <tt class="py-line"><tt class="py-docstring">    need, but should either preserve the base ``save()`` or implement</tt> </tt>
<a name="L30"></a><tt class="py-lineno"> 30</tt>  <tt class="py-line"><tt class="py-docstring">    a ``save()`` which accepts the ``profile_callback`` keyword</tt> </tt>
<a name="L31"></a><tt class="py-lineno"> 31</tt>  <tt class="py-line"><tt class="py-docstring">    argument and passes it through to</tt> </tt>
<a name="L32"></a><tt class="py-lineno"> 32</tt>  <tt class="py-line"><tt class="py-docstring">    ``RegistrationProfile.objects.create_inactive_user()``.</tt> </tt>
<a name="L33"></a><tt class="py-lineno"> 33</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L34"></a><tt class="py-lineno"> 34</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L35"></a><tt class="py-lineno"> 35</tt>  <tt class="py-line">    <tt id="link-7" class="py-name" targets="Variable digichef.registration.forms.RegistrationForm.username=digichef.registration.forms.RegistrationForm-class.html#username"><a title="digichef.registration.forms.RegistrationForm.username" class="py-name" href="#" onclick="return doclink('link-7', 'username', 'link-7');">username</a></tt> <tt class="py-op">=</tt> <tt id="link-8" class="py-name"><a title="digichef.profiles.forms
digichef.recipes.forms
digichef.registration.forms
digichef.tagging.forms" class="py-name" href="#" onclick="return doclink('link-8', 'forms', 'link-0');">forms</a></tt><tt class="py-op">.</tt><tt class="py-name">RegexField</tt><tt class="py-op">(</tt><tt class="py-name">regex</tt><tt class="py-op">=</tt><tt class="py-string">r'^\w+$'</tt><tt class="py-op">,</tt> </tt>
<a name="L36"></a><tt class="py-lineno"> 36</tt>  <tt class="py-line">                                <tt class="py-name">max_length</tt><tt class="py-op">=</tt><tt class="py-number">30</tt><tt class="py-op">,</tt> </tt>
<a name="L37"></a><tt class="py-lineno"> 37</tt>  <tt class="py-line">                                <tt class="py-name">widget</tt><tt class="py-op">=</tt><tt id="link-9" class="py-name"><a title="digichef.profiles.forms
digichef.recipes.forms
digichef.registration.forms
digichef.tagging.forms" class="py-name" href="#" onclick="return doclink('link-9', 'forms', 'link-0');">forms</a></tt><tt class="py-op">.</tt><tt class="py-name">TextInput</tt><tt class="py-op">(</tt><tt class="py-name">attrs</tt><tt class="py-op">=</tt><tt id="link-10" class="py-name"><a title="digichef.registration.forms.attrs_dict" class="py-name" href="#" onclick="return doclink('link-10', 'attrs_dict', 'link-6');">attrs_dict</a></tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L38"></a><tt class="py-lineno"> 38</tt>  <tt class="py-line">                                <tt class="py-name">label</tt><tt class="py-op">=</tt><tt class="py-name">_</tt><tt class="py-op">(</tt><tt class="py-string">u'username'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L39"></a><tt class="py-lineno"> 39</tt>  <tt class="py-line">    <tt id="link-11" class="py-name" targets="Variable digichef.profiles.forms.ProfileForm.email=digichef.profiles.forms.ProfileForm-class.html#email,Variable digichef.registration.forms.RegistrationForm.email=digichef.registration.forms.RegistrationForm-class.html#email"><a title="digichef.profiles.forms.ProfileForm.email
digichef.registration.forms.RegistrationForm.email" class="py-name" href="#" onclick="return doclink('link-11', 'email', 'link-11');">email</a></tt> <tt class="py-op">=</tt> <tt id="link-12" class="py-name"><a title="digichef.profiles.forms
digichef.recipes.forms
digichef.registration.forms
digichef.tagging.forms" class="py-name" href="#" onclick="return doclink('link-12', 'forms', 'link-0');">forms</a></tt><tt class="py-op">.</tt><tt class="py-name">EmailField</tt><tt class="py-op">(</tt><tt class="py-name">widget</tt><tt class="py-op">=</tt><tt id="link-13" class="py-name"><a title="digichef.profiles.forms
digichef.recipes.forms
digichef.registration.forms
digichef.tagging.forms" class="py-name" href="#" onclick="return doclink('link-13', 'forms', 'link-0');">forms</a></tt><tt class="py-op">.</tt><tt class="py-name">TextInput</tt><tt class="py-op">(</tt><tt class="py-name">attrs</tt><tt class="py-op">=</tt><tt class="py-name">dict</tt><tt class="py-op">(</tt><tt id="link-14" class="py-name"><a title="digichef.registration.forms.attrs_dict" class="py-name" href="#" onclick="return doclink('link-14', 'attrs_dict', 'link-6');">attrs_dict</a></tt><tt class="py-op">,</tt> </tt>
<a name="L40"></a><tt class="py-lineno"> 40</tt>  <tt class="py-line">                                                               <tt class="py-name">maxlength</tt><tt class="py-op">=</tt><tt class="py-number">75</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L41"></a><tt class="py-lineno"> 41</tt>  <tt class="py-line">                             <tt class="py-name">label</tt><tt class="py-op">=</tt><tt class="py-name">_</tt><tt class="py-op">(</tt><tt class="py-string">u'email address'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L42"></a><tt class="py-lineno"> 42</tt>  <tt class="py-line">    <tt id="link-15" class="py-name" targets="Variable digichef.registration.forms.RegistrationForm.password1=digichef.registration.forms.RegistrationForm-class.html#password1"><a title="digichef.registration.forms.RegistrationForm.password1" class="py-name" href="#" onclick="return doclink('link-15', 'password1', 'link-15');">password1</a></tt> <tt class="py-op">=</tt> <tt id="link-16" class="py-name"><a title="digichef.profiles.forms
digichef.recipes.forms
digichef.registration.forms
digichef.tagging.forms" class="py-name" href="#" onclick="return doclink('link-16', 'forms', 'link-0');">forms</a></tt><tt class="py-op">.</tt><tt class="py-name">CharField</tt><tt class="py-op">(</tt><tt class="py-name">widget</tt><tt class="py-op">=</tt><tt id="link-17" class="py-name"><a title="digichef.profiles.forms
digichef.recipes.forms
digichef.registration.forms
digichef.tagging.forms" class="py-name" href="#" onclick="return doclink('link-17', 'forms', 'link-0');">forms</a></tt><tt class="py-op">.</tt><tt class="py-name">PasswordInput</tt><tt class="py-op">(</tt><tt class="py-name">attrs</tt><tt class="py-op">=</tt><tt id="link-18" class="py-name"><a title="digichef.registration.forms.attrs_dict" class="py-name" href="#" onclick="return doclink('link-18', 'attrs_dict', 'link-6');">attrs_dict</a></tt><tt class="py-op">,</tt> <tt class="py-name">render_value</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L43"></a><tt class="py-lineno"> 43</tt>  <tt class="py-line">                                <tt class="py-name">label</tt><tt class="py-op">=</tt><tt class="py-name">_</tt><tt class="py-op">(</tt><tt class="py-string">u'password'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L44"></a><tt class="py-lineno"> 44</tt>  <tt class="py-line">    <tt id="link-19" class="py-name" targets="Variable digichef.registration.forms.RegistrationForm.password2=digichef.registration.forms.RegistrationForm-class.html#password2"><a title="digichef.registration.forms.RegistrationForm.password2" class="py-name" href="#" onclick="return doclink('link-19', 'password2', 'link-19');">password2</a></tt> <tt class="py-op">=</tt> <tt id="link-20" class="py-name"><a title="digichef.profiles.forms
digichef.recipes.forms
digichef.registration.forms
digichef.tagging.forms" class="py-name" href="#" onclick="return doclink('link-20', 'forms', 'link-0');">forms</a></tt><tt class="py-op">.</tt><tt class="py-name">CharField</tt><tt class="py-op">(</tt><tt class="py-name">widget</tt><tt class="py-op">=</tt><tt id="link-21" class="py-name"><a title="digichef.profiles.forms
digichef.recipes.forms
digichef.registration.forms
digichef.tagging.forms" class="py-name" href="#" onclick="return doclink('link-21', 'forms', 'link-0');">forms</a></tt><tt class="py-op">.</tt><tt class="py-name">PasswordInput</tt><tt class="py-op">(</tt><tt class="py-name">attrs</tt><tt class="py-op">=</tt><tt id="link-22" class="py-name"><a title="digichef.registration.forms.attrs_dict" class="py-name" href="#" onclick="return doclink('link-22', 'attrs_dict', 'link-6');">attrs_dict</a></tt><tt class="py-op">,</tt> <tt class="py-name">render_value</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L45"></a><tt class="py-lineno"> 45</tt>  <tt class="py-line">                                <tt class="py-name">label</tt><tt class="py-op">=</tt><tt class="py-name">_</tt><tt class="py-op">(</tt><tt class="py-string">u'password (again)'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L46"></a><tt class="py-lineno"> 46</tt>  <tt class="py-line">     </tt>
<a name="RegistrationForm.clean_username"></a><div id="RegistrationForm.clean_username-def"><a name="L47"></a><tt class="py-lineno"> 47</tt> <a class="py-toggle" href="#" id="RegistrationForm.clean_username-toggle" onclick="return toggle('RegistrationForm.clean_username');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="digichef.registration.forms.RegistrationForm-class.html#clean_username">clean_username</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="RegistrationForm.clean_username-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="RegistrationForm.clean_username-expanded"><a name="L48"></a><tt class="py-lineno"> 48</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L49"></a><tt class="py-lineno"> 49</tt>  <tt class="py-line"><tt class="py-docstring">        Validate that the username is alphanumeric and is not already</tt> </tt>
<a name="L50"></a><tt class="py-lineno"> 50</tt>  <tt class="py-line"><tt class="py-docstring">        in use.</tt> </tt>
<a name="L51"></a><tt class="py-lineno"> 51</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L52"></a><tt class="py-lineno"> 52</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L53"></a><tt class="py-lineno"> 53</tt>  <tt class="py-line">        <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L54"></a><tt class="py-lineno"> 54</tt>  <tt class="py-line">            <tt id="link-23" class="py-name" targets="Variable digichef.profiles.models.Profile.user=digichef.profiles.models.Profile-class.html#user,Variable digichef.registration.models.RegistrationProfile.user=digichef.registration.models.RegistrationProfile-class.html#user,Variable digichef.util.models.UserMeta.user=digichef.util.models.UserMeta-class.html#user,Variable digichef.voting.models.Vote.user=digichef.voting.models.Vote-class.html#user"><a title="digichef.profiles.models.Profile.user
digichef.registration.models.RegistrationProfile.user
digichef.util.models.UserMeta.user
digichef.voting.models.Vote.user" class="py-name" href="#" onclick="return doclink('link-23', 'user', 'link-23');">user</a></tt> <tt class="py-op">=</tt> <tt class="py-name">User</tt><tt class="py-op">.</tt><tt id="link-24" class="py-name" targets="Variable digichef.recommender.models.Recommender.objects=digichef.recommender.models.Recommender-class.html#objects,Variable digichef.registration.models.RegistrationProfile.objects=digichef.registration.models.RegistrationProfile-class.html#objects,Variable digichef.tagging.models.Tag.objects=digichef.tagging.models.Tag-class.html#objects,Variable digichef.tagging.models.TaggedItem.objects=digichef.tagging.models.TaggedItem-class.html#objects,Variable digichef.voting.models.Vote.objects=digichef.voting.models.Vote-class.html#objects"><a title="digichef.recommender.models.Recommender.objects
digichef.registration.models.RegistrationProfile.objects
digichef.tagging.models.Tag.objects
digichef.tagging.models.TaggedItem.objects
digichef.voting.models.Vote.objects" class="py-name" href="#" onclick="return doclink('link-24', 'objects', 'link-24');">objects</a></tt><tt class="py-op">.</tt><tt class="py-name">get</tt><tt class="py-op">(</tt><tt class="py-name">username__iexact</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">cleaned_data</tt><tt class="py-op">[</tt><tt class="py-string">'username'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L55"></a><tt class="py-lineno"> 55</tt>  <tt class="py-line">        <tt class="py-keyword">except</tt> <tt class="py-name">User</tt><tt class="py-op">.</tt><tt class="py-name">DoesNotExist</tt><tt class="py-op">:</tt> </tt>
<a name="L56"></a><tt class="py-lineno"> 56</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">cleaned_data</tt><tt class="py-op">[</tt><tt class="py-string">'username'</tt><tt class="py-op">]</tt> </tt>
<a name="L57"></a><tt class="py-lineno"> 57</tt>  <tt class="py-line">        <tt class="py-keyword">raise</tt> <tt id="link-25" class="py-name"><a title="digichef.profiles.forms
digichef.recipes.forms
digichef.registration.forms
digichef.tagging.forms" class="py-name" href="#" onclick="return doclink('link-25', 'forms', 'link-0');">forms</a></tt><tt class="py-op">.</tt><tt class="py-name">ValidationError</tt><tt class="py-op">(</tt><tt class="py-name">_</tt><tt class="py-op">(</tt><tt class="py-string">u'This username is already taken. Please choose another.'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L58"></a><tt class="py-lineno"> 58</tt>  <tt class="py-line"> </tt>
<a name="RegistrationForm.clean"></a><div id="RegistrationForm.clean-def"><a name="L59"></a><tt class="py-lineno"> 59</tt> <a class="py-toggle" href="#" id="RegistrationForm.clean-toggle" onclick="return toggle('RegistrationForm.clean');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="digichef.registration.forms.RegistrationForm-class.html#clean">clean</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="RegistrationForm.clean-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="RegistrationForm.clean-expanded"><a name="L60"></a><tt class="py-lineno"> 60</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L61"></a><tt class="py-lineno"> 61</tt>  <tt class="py-line"><tt class="py-docstring">        Verifiy that the values entered into the two password fields</tt> </tt>
<a name="L62"></a><tt class="py-lineno"> 62</tt>  <tt class="py-line"><tt class="py-docstring">        match. Note that an error here will end up in</tt> </tt>
<a name="L63"></a><tt class="py-lineno"> 63</tt>  <tt class="py-line"><tt class="py-docstring">        ``non_field_errors()`` because it doesn't apply to a single</tt> </tt>
<a name="L64"></a><tt class="py-lineno"> 64</tt>  <tt class="py-line"><tt class="py-docstring">        field.</tt> </tt>
<a name="L65"></a><tt class="py-lineno"> 65</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L66"></a><tt class="py-lineno"> 66</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L67"></a><tt class="py-lineno"> 67</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-string">'password1'</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">cleaned_data</tt> <tt class="py-keyword">and</tt> <tt class="py-string">'password2'</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">cleaned_data</tt><tt class="py-op">:</tt> </tt>
<a name="L68"></a><tt class="py-lineno"> 68</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">cleaned_data</tt><tt class="py-op">[</tt><tt class="py-string">'password1'</tt><tt class="py-op">]</tt> <tt class="py-op">!=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">cleaned_data</tt><tt class="py-op">[</tt><tt class="py-string">'password2'</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
<a name="L69"></a><tt class="py-lineno"> 69</tt>  <tt class="py-line">                <tt class="py-keyword">raise</tt> <tt id="link-26" class="py-name"><a title="digichef.profiles.forms
digichef.recipes.forms
digichef.registration.forms
digichef.tagging.forms" class="py-name" href="#" onclick="return doclink('link-26', 'forms', 'link-0');">forms</a></tt><tt class="py-op">.</tt><tt class="py-name">ValidationError</tt><tt class="py-op">(</tt><tt class="py-name">_</tt><tt class="py-op">(</tt><tt class="py-string">u'You must type the same password each time'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L70"></a><tt class="py-lineno"> 70</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">cleaned_data</tt> </tt>
</div><a name="L71"></a><tt class="py-lineno"> 71</tt>  <tt class="py-line">     </tt>
<a name="RegistrationForm.save"></a><div id="RegistrationForm.save-def"><a name="L72"></a><tt class="py-lineno"> 72</tt> <a class="py-toggle" href="#" id="RegistrationForm.save-toggle" onclick="return toggle('RegistrationForm.save');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="digichef.registration.forms.RegistrationForm-class.html#save">save</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">profile_callback</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="RegistrationForm.save-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="RegistrationForm.save-expanded"><a name="L73"></a><tt class="py-lineno"> 73</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L74"></a><tt class="py-lineno"> 74</tt>  <tt class="py-line"><tt class="py-docstring">        Create the new ``User`` and ``RegistrationProfile``, and</tt> </tt>
<a name="L75"></a><tt class="py-lineno"> 75</tt>  <tt class="py-line"><tt class="py-docstring">        returns the ``User``.</tt> </tt>
<a name="L76"></a><tt class="py-lineno"> 76</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L77"></a><tt class="py-lineno"> 77</tt>  <tt class="py-line"><tt class="py-docstring">        This is essentially a light wrapper around</tt> </tt>
<a name="L78"></a><tt class="py-lineno"> 78</tt>  <tt class="py-line"><tt class="py-docstring">        ``RegistrationProfile.objects.create_inactive_user()``,</tt> </tt>
<a name="L79"></a><tt class="py-lineno"> 79</tt>  <tt class="py-line"><tt class="py-docstring">        feeding it the form data and a profile callback (see the</tt> </tt>
<a name="L80"></a><tt class="py-lineno"> 80</tt>  <tt class="py-line"><tt class="py-docstring">        documentation on ``create_inactive_user()`` for details) if</tt> </tt>
<a name="L81"></a><tt class="py-lineno"> 81</tt>  <tt class="py-line"><tt class="py-docstring">        supplied.</tt> </tt>
<a name="L82"></a><tt class="py-lineno"> 82</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L83"></a><tt class="py-lineno"> 83</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L84"></a><tt class="py-lineno"> 84</tt>  <tt class="py-line">        <tt class="py-name">new_user</tt> <tt class="py-op">=</tt> <tt id="link-27" class="py-name"><a title="digichef.registration.models.RegistrationProfile" class="py-name" href="#" onclick="return doclink('link-27', 'RegistrationProfile', 'link-5');">RegistrationProfile</a></tt><tt class="py-op">.</tt><tt id="link-28" class="py-name"><a title="digichef.recommender.models.Recommender.objects
digichef.registration.models.RegistrationProfile.objects
digichef.tagging.models.Tag.objects
digichef.tagging.models.TaggedItem.objects
digichef.voting.models.Vote.objects" class="py-name" href="#" onclick="return doclink('link-28', 'objects', 'link-24');">objects</a></tt><tt class="py-op">.</tt><tt id="link-29" class="py-name" targets="Method digichef.registration.models.RegistrationManager.create_inactive_user()=digichef.registration.models.RegistrationManager-class.html#create_inactive_user"><a title="digichef.registration.models.RegistrationManager.create_inactive_user" class="py-name" href="#" onclick="return doclink('link-29', 'create_inactive_user', 'link-29');">create_inactive_user</a></tt><tt class="py-op">(</tt><tt id="link-30" class="py-name"><a title="digichef.registration.forms.RegistrationForm.username" class="py-name" href="#" onclick="return doclink('link-30', 'username', 'link-7');">username</a></tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">cleaned_data</tt><tt class="py-op">[</tt><tt class="py-string">'username'</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
<a name="L85"></a><tt class="py-lineno"> 85</tt>  <tt class="py-line">                                                                    <tt class="py-name">password</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">cleaned_data</tt><tt class="py-op">[</tt><tt class="py-string">'password1'</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
<a name="L86"></a><tt class="py-lineno"> 86</tt>  <tt class="py-line">                                                                    <tt id="link-31" class="py-name"><a title="digichef.profiles.forms.ProfileForm.email
digichef.registration.forms.RegistrationForm.email" class="py-name" href="#" onclick="return doclink('link-31', 'email', 'link-11');">email</a></tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">cleaned_data</tt><tt class="py-op">[</tt><tt class="py-string">'email'</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
<a name="L87"></a><tt class="py-lineno"> 87</tt>  <tt class="py-line">                                                                    <tt class="py-name">profile_callback</tt><tt class="py-op">=</tt><tt class="py-name">profile_callback</tt><tt class="py-op">)</tt> </tt>
<a name="L88"></a><tt class="py-lineno"> 88</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">new_user</tt> </tt>
</div></div><a name="L89"></a><tt class="py-lineno"> 89</tt>  <tt class="py-line"> </tt>
<a name="L90"></a><tt class="py-lineno"> 90</tt>  <tt class="py-line"> </tt>
<a name="RegistrationFormTermsOfService"></a><div id="RegistrationFormTermsOfService-def"><a name="L91"></a><tt class="py-lineno"> 91</tt> <a class="py-toggle" href="#" id="RegistrationFormTermsOfService-toggle" onclick="return toggle('RegistrationFormTermsOfService');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="digichef.registration.forms.RegistrationFormTermsOfService-class.html">RegistrationFormTermsOfService</a><tt class="py-op">(</tt><tt class="py-base-class">RegistrationForm</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="RegistrationFormTermsOfService-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="RegistrationFormTermsOfService-expanded"><a name="L92"></a><tt class="py-lineno"> 92</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L93"></a><tt class="py-lineno"> 93</tt>  <tt class="py-line"><tt class="py-docstring">    Subclass of ``RegistrationForm`` which adds a required checkbox</tt> </tt>
<a name="L94"></a><tt class="py-lineno"> 94</tt>  <tt class="py-line"><tt class="py-docstring">    for agreeing to a site's Terms of Service.</tt> </tt>
<a name="L95"></a><tt class="py-lineno"> 95</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L96"></a><tt class="py-lineno"> 96</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L97"></a><tt class="py-lineno"> 97</tt>  <tt class="py-line">    <tt id="link-32" class="py-name" targets="Variable digichef.registration.forms.RegistrationFormTermsOfService.tos=digichef.registration.forms.RegistrationFormTermsOfService-class.html#tos"><a title="digichef.registration.forms.RegistrationFormTermsOfService.tos" class="py-name" href="#" onclick="return doclink('link-32', 'tos', 'link-32');">tos</a></tt> <tt class="py-op">=</tt> <tt id="link-33" class="py-name"><a title="digichef.profiles.forms
digichef.recipes.forms
digichef.registration.forms
digichef.tagging.forms" class="py-name" href="#" onclick="return doclink('link-33', 'forms', 'link-0');">forms</a></tt><tt class="py-op">.</tt><tt class="py-name">BooleanField</tt><tt class="py-op">(</tt><tt class="py-name">widget</tt><tt class="py-op">=</tt><tt id="link-34" class="py-name"><a title="digichef.profiles.forms
digichef.recipes.forms
digichef.registration.forms
digichef.tagging.forms" class="py-name" href="#" onclick="return doclink('link-34', 'forms', 'link-0');">forms</a></tt><tt class="py-op">.</tt><tt class="py-name">CheckboxInput</tt><tt class="py-op">(</tt><tt class="py-name">attrs</tt><tt class="py-op">=</tt><tt id="link-35" class="py-name"><a title="digichef.registration.forms.attrs_dict" class="py-name" href="#" onclick="return doclink('link-35', 'attrs_dict', 'link-6');">attrs_dict</a></tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L98"></a><tt class="py-lineno"> 98</tt>  <tt class="py-line">                             <tt class="py-name">label</tt><tt class="py-op">=</tt><tt class="py-name">_</tt><tt class="py-op">(</tt><tt class="py-string">u'I have read and agree to the Terms of Service'</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L99"></a><tt class="py-lineno"> 99</tt>  <tt class="py-line">                             <tt class="py-name">error_messages</tt><tt class="py-op">=</tt><tt class="py-op">{</tt> <tt class="py-string">'required'</tt><tt class="py-op">:</tt> <tt class="py-string">u"You must agree to the terms to register"</tt> <tt class="py-op">}</tt><tt class="py-op">)</tt> </tt>
</div><a name="L100"></a><tt class="py-lineno">100</tt>  <tt class="py-line"> </tt>
<a name="L101"></a><tt class="py-lineno">101</tt>  <tt class="py-line"> </tt>
<a name="RegistrationFormUniqueEmail"></a><div id="RegistrationFormUniqueEmail-def"><a name="L102"></a><tt class="py-lineno">102</tt> <a class="py-toggle" href="#" id="RegistrationFormUniqueEmail-toggle" onclick="return toggle('RegistrationFormUniqueEmail');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="digichef.registration.forms.RegistrationFormUniqueEmail-class.html">RegistrationFormUniqueEmail</a><tt class="py-op">(</tt><tt class="py-base-class">RegistrationForm</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="RegistrationFormUniqueEmail-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="RegistrationFormUniqueEmail-expanded"><a name="L103"></a><tt class="py-lineno">103</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L104"></a><tt class="py-lineno">104</tt>  <tt class="py-line"><tt class="py-docstring">    Subclass of ``RegistrationForm`` which enforces uniqueness of</tt> </tt>
<a name="L105"></a><tt class="py-lineno">105</tt>  <tt class="py-line"><tt class="py-docstring">    email addresses.</tt> </tt>
<a name="L106"></a><tt class="py-lineno">106</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L107"></a><tt class="py-lineno">107</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="RegistrationFormUniqueEmail.clean_email"></a><div id="RegistrationFormUniqueEmail.clean_email-def"><a name="L108"></a><tt class="py-lineno">108</tt> <a class="py-toggle" href="#" id="RegistrationFormUniqueEmail.clean_email-toggle" onclick="return toggle('RegistrationFormUniqueEmail.clean_email');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="digichef.registration.forms.RegistrationFormUniqueEmail-class.html#clean_email">clean_email</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="RegistrationFormUniqueEmail.clean_email-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="RegistrationFormUniqueEmail.clean_email-expanded"><a name="L109"></a><tt class="py-lineno">109</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L110"></a><tt class="py-lineno">110</tt>  <tt class="py-line"><tt class="py-docstring">        Validate that the supplied email address is unique for the</tt> </tt>
<a name="L111"></a><tt class="py-lineno">111</tt>  <tt class="py-line"><tt class="py-docstring">        site.</tt> </tt>
<a name="L112"></a><tt class="py-lineno">112</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L113"></a><tt class="py-lineno">113</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L114"></a><tt class="py-lineno">114</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">User</tt><tt class="py-op">.</tt><tt id="link-36" class="py-name"><a title="digichef.recommender.models.Recommender.objects
digichef.registration.models.RegistrationProfile.objects
digichef.tagging.models.Tag.objects
digichef.tagging.models.TaggedItem.objects
digichef.voting.models.Vote.objects" class="py-name" href="#" onclick="return doclink('link-36', 'objects', 'link-24');">objects</a></tt><tt class="py-op">.</tt><tt class="py-name">filter</tt><tt class="py-op">(</tt><tt class="py-name">email__iexact</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">cleaned_data</tt><tt class="py-op">[</tt><tt class="py-string">'email'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L115"></a><tt class="py-lineno">115</tt>  <tt class="py-line">            <tt class="py-keyword">raise</tt> <tt id="link-37" class="py-name"><a title="digichef.profiles.forms
digichef.recipes.forms
digichef.registration.forms
digichef.tagging.forms" class="py-name" href="#" onclick="return doclink('link-37', 'forms', 'link-0');">forms</a></tt><tt class="py-op">.</tt><tt class="py-name">ValidationError</tt><tt class="py-op">(</tt><tt class="py-name">_</tt><tt class="py-op">(</tt><tt class="py-string">u'This email address is already in use. Please supply a different email address.'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L116"></a><tt class="py-lineno">116</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">cleaned_data</tt><tt class="py-op">[</tt><tt class="py-string">'email'</tt><tt class="py-op">]</tt> </tt>
</div></div><a name="L117"></a><tt class="py-lineno">117</tt>  <tt class="py-line"> </tt>
<a name="L118"></a><tt class="py-lineno">118</tt>  <tt class="py-line"> </tt>
<a name="RegistrationFormNoFreeEmail"></a><div id="RegistrationFormNoFreeEmail-def"><a name="L119"></a><tt class="py-lineno">119</tt> <a class="py-toggle" href="#" id="RegistrationFormNoFreeEmail-toggle" onclick="return toggle('RegistrationFormNoFreeEmail');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="digichef.registration.forms.RegistrationFormNoFreeEmail-class.html">RegistrationFormNoFreeEmail</a><tt class="py-op">(</tt><tt class="py-base-class">RegistrationForm</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="RegistrationFormNoFreeEmail-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="RegistrationFormNoFreeEmail-expanded"><a name="L120"></a><tt class="py-lineno">120</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L121"></a><tt class="py-lineno">121</tt>  <tt class="py-line"><tt class="py-docstring">    Subclass of ``RegistrationForm`` which disallows registration with</tt> </tt>
<a name="L122"></a><tt class="py-lineno">122</tt>  <tt class="py-line"><tt class="py-docstring">    email addresses from popular free webmail services; moderately</tt> </tt>
<a name="L123"></a><tt class="py-lineno">123</tt>  <tt class="py-line"><tt class="py-docstring">    useful for preventing automated spam registrations.</tt> </tt>
<a name="L124"></a><tt class="py-lineno">124</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L125"></a><tt class="py-lineno">125</tt>  <tt class="py-line"><tt class="py-docstring">    To change the list of banned domains, subclass this form and</tt> </tt>
<a name="L126"></a><tt class="py-lineno">126</tt>  <tt class="py-line"><tt class="py-docstring">    override the attribute ``bad_domains``.</tt> </tt>
<a name="L127"></a><tt class="py-lineno">127</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L128"></a><tt class="py-lineno">128</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L129"></a><tt class="py-lineno">129</tt>  <tt class="py-line">    <tt id="link-38" class="py-name" targets="Variable digichef.registration.forms.RegistrationFormNoFreeEmail.bad_domains=digichef.registration.forms.RegistrationFormNoFreeEmail-class.html#bad_domains"><a title="digichef.registration.forms.RegistrationFormNoFreeEmail.bad_domains" class="py-name" href="#" onclick="return doclink('link-38', 'bad_domains', 'link-38');">bad_domains</a></tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-string">'aim.com'</tt><tt class="py-op">,</tt> <tt class="py-string">'aol.com'</tt><tt class="py-op">,</tt> <tt class="py-string">'email.com'</tt><tt class="py-op">,</tt> <tt class="py-string">'gmail.com'</tt><tt class="py-op">,</tt> </tt>
<a name="L130"></a><tt class="py-lineno">130</tt>  <tt class="py-line">                   <tt class="py-string">'googlemail.com'</tt><tt class="py-op">,</tt> <tt class="py-string">'hotmail.com'</tt><tt class="py-op">,</tt> <tt class="py-string">'hushmail.com'</tt><tt class="py-op">,</tt> </tt>
<a name="L131"></a><tt class="py-lineno">131</tt>  <tt class="py-line">                   <tt class="py-string">'msn.com'</tt><tt class="py-op">,</tt> <tt class="py-string">'mail.ru'</tt><tt class="py-op">,</tt> <tt class="py-string">'mailinator.com'</tt><tt class="py-op">,</tt> <tt class="py-string">'live.com'</tt><tt class="py-op">]</tt> </tt>
<a name="L132"></a><tt class="py-lineno">132</tt>  <tt class="py-line">     </tt>
<a name="RegistrationFormNoFreeEmail.clean_email"></a><div id="RegistrationFormNoFreeEmail.clean_email-def"><a name="L133"></a><tt class="py-lineno">133</tt> <a class="py-toggle" href="#" id="RegistrationFormNoFreeEmail.clean_email-toggle" onclick="return toggle('RegistrationFormNoFreeEmail.clean_email');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="digichef.registration.forms.RegistrationFormNoFreeEmail-class.html#clean_email">clean_email</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="RegistrationFormNoFreeEmail.clean_email-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="RegistrationFormNoFreeEmail.clean_email-expanded"><a name="L134"></a><tt class="py-lineno">134</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L135"></a><tt class="py-lineno">135</tt>  <tt class="py-line"><tt class="py-docstring">        Check the supplied email address against a list of known free</tt> </tt>
<a name="L136"></a><tt class="py-lineno">136</tt>  <tt class="py-line"><tt class="py-docstring">        webmail domains.</tt> </tt>
<a name="L137"></a><tt class="py-lineno">137</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L138"></a><tt class="py-lineno">138</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L139"></a><tt class="py-lineno">139</tt>  <tt class="py-line">        <tt class="py-name">email_domain</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">cleaned_data</tt><tt class="py-op">[</tt><tt class="py-string">'email'</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-39" class="py-name" targets="Function re.split()=re-module.html#split"><a title="re.split" class="py-name" href="#" onclick="return doclink('link-39', 'split', 'link-39');">split</a></tt><tt class="py-op">(</tt><tt class="py-string">'@'</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> </tt>
<a name="L140"></a><tt class="py-lineno">140</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">email_domain</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-40" class="py-name"><a title="digichef.registration.forms.RegistrationFormNoFreeEmail.bad_domains" class="py-name" href="#" onclick="return doclink('link-40', 'bad_domains', 'link-38');">bad_domains</a></tt><tt class="py-op">:</tt> </tt>
<a name="L141"></a><tt class="py-lineno">141</tt>  <tt class="py-line">            <tt class="py-keyword">raise</tt> <tt id="link-41" class="py-name"><a title="digichef.profiles.forms
digichef.recipes.forms
digichef.registration.forms
digichef.tagging.forms" class="py-name" href="#" onclick="return doclink('link-41', 'forms', 'link-0');">forms</a></tt><tt class="py-op">.</tt><tt class="py-name">ValidationError</tt><tt class="py-op">(</tt><tt class="py-name">_</tt><tt class="py-op">(</tt><tt class="py-string">u'Registration using free email addresses is prohibited. Please supply a different email address.'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L142"></a><tt class="py-lineno">142</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">cleaned_data</tt><tt class="py-op">[</tt><tt class="py-string">'email'</tt><tt class="py-op">]</tt> </tt>
</div></div><a name="L143"></a><tt class="py-lineno">143</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Thu Apr  1 02:28:30 2010
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
